package com.dpj.visibility_test;

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.Test1")
public class Test1 {
    public  volatile static boolean run=true;
    public static void main(String[] args) throws InterruptedException {

        Thread t1 = new Thread(() -> {
            while (run) {

            }
        });
        t1.start();
        Thread.sleep(1000);
        log.debug("停止t1");
        run=false;
    }
}
